/*
 * Copyright (C) 2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.kelin.calendarlistview;

import com.kelin.calendarlistview.library.CalendarHelper;
import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry;
import org.junit.Test;

import java.util.Calendar;

import static org.junit.Assert.assertEquals;

public class ExampleOhosTest {
    /**
     * testBundleName
     */
    @Test
    public void testBundleName() {
        final String actualBundleName = AbilityDelegatorRegistry.getArguments().getTestBundleName();
        assertEquals("com.kelin.calendarlistview", actualBundleName);
    }

    /**
     * testGetCalendarByYearMonthDay
     */
    @Test
    public void testGetCalendarByYearMonthDay() {
        Calendar calendar = Calendar.getInstance();
        assertEquals(calendar.getFirstDayOfWeek(), CalendarAbilitySlice.getCalendarByYearMonthDay("").getFirstDayOfWeek());
    }

    /**
     * testDp2px
     */
    @Test
    public void testDp2px() {
        assertEquals(0, CalendarHelper.dp2px(1));
    }

    /**
     * testGetNewsCount
     */
    @Test
    public void testGetNewsCount() {
        CustomCalendarItemModel customCalendarItemModel = new CustomCalendarItemModel();
        assertEquals(0, customCalendarItemModel.getNewsCount());
    }

    /**
     * testSetNewsCount
     */
    @Test
    public void testSetNewsCount() {
        CustomCalendarItemModel customCalendarItemModel = new CustomCalendarItemModel();
        customCalendarItemModel.setNewsCount(1);
        assertEquals(1, customCalendarItemModel.getNewsCount());
    }

    /**
     * testIsFav
     */
    @Test
    public void testIsFav() {
        CustomCalendarItemModel customCalendarItemModel = new CustomCalendarItemModel();
        assertEquals(false, customCalendarItemModel.isFav());
    }

    /**
     * testSetFav
     */
    @Test
    public void testSetFav() {
        CustomCalendarItemModel customCalendarItemModel = new CustomCalendarItemModel();
        customCalendarItemModel.setFav(true);
        assertEquals(true, customCalendarItemModel.isFav());
    }
}